package tv.acgn.advertisement.search.indexobejct;

import java.math.BigDecimal;
import java.time.LocalDateTime;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

import lombok.Builder;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

/**
 * @author : junG
 * @program : advertisement-ad-search0-index-object
 * @description : 推广单元索引对象 IndexObject
 * @date : 2019-07-07 22:50
 **/
@Data
@Builder
public class AdUnitIO {

    private String unitId;

    /**
     * 推广单元 相关的推广计划
     */
    private String planId;

    private String unitName;

    /**
     * 推广单元状态
     */
    private Integer unitStatus;

    /**
     * 广告位类型
     */
    @Column(name = "position_type", nullable = false)
    private Integer positionType;

    /**
     * 推广单元预算
     */
    private BigDecimal budget;

    /**
     * 推广计划 引用对象
     */
    private AdPlanIO adPlanIO;

    /**
     * 空索引对象
     * 避免击穿索引层
     * @return AdUnitIO
     */
    public static AdUnitIO emptyIO() {
        return AdUnitIO.builder()
            .unitId("empty_AdUnitIO")
            .planId("empty_AdPlanIO")
            .unitName("未找到索引")
            .build();
    }
}
